#### Meta Data ####

# article: "The Ambivalent Effect of Autocratization on Domestic Terrorism" 
# journal: "Studies in Conflict & Terrorism"
# authors: "Lott, Lars; Croissant, Aurel; Trinn. Christoph"
# date: 2023-10-02
# written under "R version 4.3.1 (2023-06-16 ucrt)"


## Introduction
This replication folder contains the necessary files and instructions to reproduce the findings of the research paper titled "The Ambivalent Effect of
Autocratization on Domestic Terrorism". The purpose of this README is to guide you through the replication process.

## Folder Structure
The replication folder is organized as follows:

/data: Contains the datasets used in the research, including the datset that are necessary for the dataset construction
/outputs: Stores the figures obtained from the research.
/results: Stores the results to build the figures and additional supporting material

## Dependencies
The following software dependencies are required to replicate the research:

- R version 4.3.1 
- Packages: tidyverse, MASS, multiwayvcov, ggeffects, ggpubr, here, haven, imputeTS, modelsummary, data.table, PanelMatch, patchwork

## Installation
To set up the replication environment, follow these steps:

1. Install R version 4.3.1 from the official R website (https://www.r-project.org/).
2. Install the required packages by executing the following commands in R:

   install.packages("MASS")
   install.packages("tidyverse")
   install.packages("multiwayvcov")
   install.packages("ggeffects")
   install.packages("ggpubr")
   install.packages("here")
   install.packages("haven")   
   install.packages("imputeTS")
   install.packages("modelsummary")
   install.packages("data.table")
   install.packages("PanelMatch")
   install.packages("patchwork")

Set the working directory in your R environment to the location where the replication folder is saved. 
You can use the setwd() function and specify the appropriate path.

## Data
The datasets used in this research can be found in the /data folder. The following files are required:

vdem12.rds: Contains the original replication data.
The original data files are stored in the folders. To build the replication datasets, you can use "01_data_wrangling_main_paper.R", 
"05_robustness_data_wrangling_SA_E.R" and "05_robustness_data_wrangling_SA_F.R"

## Code
The replication code can be found in the R script file, named 

	"01_data_wrangling_main_paper.R".
	"02_main_paper_reproduction.R"
	"03_robustness_test_SA_B_and_C.R"
	"04_robustness_test_SA_D.R"
	"05_robustness_data_wrangling_SA_E.R"
	"06_robustness_test_SA_E.R"
	"07_robsutness_data_wrangling_SA_F.R"
	"08_robustness_test_SA_F.R"
	"09_robustness_test_SA_G.R"

SA stands for Supplementary Appendix. 

## Contact Information
For any questions, feedback, or assistance, please contact:

Lars Lott 
lars.lott@fau.de

